package com.spring.service.Impl;

import com.spring.dao.UserDao;
import com.spring.service.ServiceDao;

public class ServiceDaoImpl implements ServiceDao {
    private UserDao userDao;

    public ServiceDaoImpl(UserDao userDao) {
        this.userDao = userDao;
    }



    @Override
    public void print() {
//        UserDao userDao = new UserDaoImpl();
//        userDao.print();
//        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("application.xml");
//        UserDao userDao = (UserDao) applicationContext.getBean("UserDao");
//        userDao.print();

        /*1.使用有参构造*/
        userDao.print();


    }
}
